<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.List"%>
<%@ page import="com.jaxplat.commons.Row"%>
<%@ page import="com.jaxplat.commons.RowImpl"%>
<%
    String contextPath = request.getContextPath();
	Row row = null;
	if (null != request.getAttribute("orderInfo")) {
		row = (Row) request.getAttribute("orderInfo");
	} else {
		row = new RowImpl();
	}
	//获取付款信息
	Row orderBillInfo = null;
	if (null != request.getAttribute("orderBillInfo")) {
	    orderBillInfo = (Row) request.getAttribute("orderBillInfo");
	} else {
	    orderBillInfo = new RowImpl();
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta content="<%=session.getAttribute("keywords")%>" name="Keywords">
		<meta
			content="<%=session.getAttribute("description")%>"
			name="description">
		<title>预约管理-云南移动无线城市</title>
		<link rel="stylesheet" type="text/css"
			href="<%=contextPath%>/css2/style.css">
		<link rel="stylesheet" type="text/css"
			href="<%=contextPath%>/js/jquery-easyui-1.3/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css"
			href="<%=contextPath%>/js/jquery-easyui-1.3/themes/icon.css">
		<script type="text/javascript"
			src="<%=contextPath%>/js/jquery-easyui-1.3/jquery-1.7.2.min.js"></script>
		<script type="text/javascript"
			src="<%=contextPath%>/js/jquery-easyui-1.3/jquery.easyui.min.js"></script>
		<script type="text/javascript"
			src="<%=contextPath%>/js/jquery-easyui-1.3/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/common.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/blockUI/jquery.blockUI.js"></script>
		<script type="text/javascript">
function refundOrder(order_id){  
	    if(order_id==null || order_id=="")
	{
		return;
	}
	if(window.confirm('您确定要退号吗？')){
		 $(document).ready(function(){  
		        $.ajax({  
		                           url :'<%=request.getContextPath()%>/web2/reserveManageAction.do?method=refund&orderId='+order_id,  //后台处理程序  
		                           type:"post",    //数据发送方式  
		                          async:false,  
		                           dataType:"json",   //接受数据格式             
		                          error: function(){  
		                           alert("服务器没有返回数据，可能服务器忙，请重试");  
		                          },  
		                           success: function(json){  
		                             var response = eval(json); 
		                            if(response.errcode=='0')
									{
										alert('退号成功!');
										window.location.reload();
									}
									else
									{
										alert(response.message);
										window.location.reload();
									}		                       
								}   
						});                     
					});  
		
		 
		 
		}
		
	} 
	
	
function cancelOrder(order_id){  
	    if(order_id==null || order_id=="")
	{
		return;
	}
	if(window.confirm('您确定要退号吗？')){
		 $(document).ready(function(){  
		        $.ajax({  
		                           url :'<%=request.getContextPath()%>/web2/reserveManageAction.do?method=cancelOrder&orderId='+order_id,  //后台处理程序  
		                           type:"post",    //数据发送方式  
		                          async:false,  
		                           dataType:"json",   //接受数据格式             
		                          error: function(){  
		                           alert("服务器没有返回数据，可能服务器忙，请重试");  
		                          },  
		                           success: function(json){  
		                             var response = eval(json); 
		                           	alert(response.message);
									window.location.reload();                    
								}   
						});                     
					});  
		
		 
		 
		}
	else
	{
		return;
	}
		
} 
</script>

<!--[if IE 6]>
 <style type="text/css">
 .w942m {
	width:942px;
	margin:0 auto;
	margin-top:150px;
}
.main_left .main_box_title {
	background: url("../images/h4bg.png") no-repeat scroll left top transparent;
	height:43px;
	margin-left:-10px;
	position:absolute;
	top:10px;
}
 </style>
<![endif]-->

<!--[if IE 7]>
 <style type="text/css">
 .w942m {
	width:942px;
	margin:0 auto;
	margin-top:150px;
}
.main_left .main_box_title {
	background: url("../images/h4bg.png") no-repeat scroll left top transparent;
	height:43px;
	margin-left:-10px;
	position:absolute;
	top:10px;
}
 </style>
<![endif]-->

	</head>
	<body>
		<%=request.getSession().getAttribute("headerContentWeb")%>
		<div class="guahao">
			<%@ include file="head.jsp"%>
			<div class="clear mb8"></div>
			<!--start main-->
			<div class="main w942m">
				<div class="main_left2 fl w150">
					<div class="main_box">
						<div class="main_box_title">
							<div class="titleleft fl"></div>
							<div class="right_titlemain fl">
								<h4 class="h4">
									预约管理
								</h4>
							</div>
							<div class="titleright fl"></div>
						</div>
						<div class="right_main_box_cont">
							<!--navlist开始-->
							<ul class="navlist">
								<li>
									<a
										href="<%=contextPathHead%>/web2/reserveManageAction.do?method=reserverOrderList&flag=1&browseFalg=web">未支付预约</a>
								</li>
								<li>
									<a
										href="<%=contextPathHead%>/web2/reserveManageAction.do?method=reserverOrderList&flag=2&browseFalg=web">我的预约</a>
								</li>
								<li>
									<a
										href="<%=contextPathHead%>/web2/reserveManageAction.do?method=reserverOrderList&flag=3&browseFalg=web">历史预约</a>
								</li>
								<li>
									<a href="<%=contextPathHead%>/web2/reserveManageAction.do?method=reserverOrderList&flag=4&browseFalg=web">常用联系人</a>
								</li>
							</ul>
							<!--navlist结束-->
						</div>
						<!--end left_main_box_cont-->
						<div class="right_box_bottom mb8"></div>
					</div>
					<!--end main_box-->
				</div>
				<!--end main_left-->
				<div class="main_right2 fl w780">
					<div class="main_box_list">
						<div class="once_top"></div>
						<div class="right_main_box_cont">
							<div class="box_keylist">
								<div class="bc">
									<div class="list_table">
										<div class="apps_titleName">
											<span class="apps_titleLeft">订单信息</span>
										</div>
										<table border="0" cellspacing="0" cellpadding="0"
											style="table-layout: fixed;" width="100%" class="infro_table">
											<thead>
												<tr>
													<th class="apps_firstth1 apps_firstth2 textL" colspan="4">
														就医信息
													</th>
												</tr>
											</thead>
											<tbody>
												<tr>
													<td class="apps_firstth1 textR">
														订单编号
													</td>
													<td><%=row.get("orderId")%></td>
													<td class="textR">
														提交时间
													</td>
													<td class="apps_firstth2"><%=row.get("createTime")%></td>
												</tr>
												<tr>
													<td class="apps_firstth1 textR">
														医院
													</td>
													<td><%=row.get("hospitalName")%></td>
													<td class="textR">
														科室及类别
													</td>
													<td class="apps_firstth2"><%=row.get("sectionName")%>-<%=row.get("secType")%></td>
												</tr>
												<tr>
													<td class="apps_firstth1 textR">
														医生
													</td>
													<td><%=row.get("doctorName")%></td>
													<td class="textR">
														预约时间
													</td>
													<td class="apps_firstth2"><%=row.get("reserveTime")%></td>
												</tr>
												<tr>
													<td class="apps_firstth1 textR">
														支付状态
													</td>
													<td>
														<%
														    if ("1".equals(row.get("payStatus").toString())) {
														%>
														未付款
														<%
														    } else if ("2".equals(row.get("payStatus").toString())) {
														%>
														已付款
														<%
														    } else if ("3".equals(row.get("payStatus").toString())) {
														%>
														已退款
														<%
														    }
														%>
													</td>
													<td class="textR">预约状态</td>
													<td class="apps_firstth2">
														<%
														    if ("1".equals(row.get("reserveStatus").toString())) {
														%>
														保留号
														<%
														    } else if ("2".equals(row.get("reserveStatus").toString())) {
														%>
														取消保留号
														<%
														    } else if ("3".equals(row.get("reserveStatus").toString())) {
														%>
														保留号过期
														<%
														    } else if ("4".equals(row.get("reserveStatus").toString())) {
														%>
														待赴约
														<%
														    } else if ("5".equals(row.get("reserveStatus").toString())) {
														%>
														已退号
														<%
														    } else if ("6".equals(row.get("reserveStatus").toString())) {
														%>
														已赴约
														<%
														    } else if ("7".equals(row.get("reserveStatus").toString())) {
														%>
														爽约
														<%
														    }
														%>
													</td>
												</tr>
											</tbody>
										</table>
										<table border="0" cellspacing="0" cellpadding="0"
											style="table-layout: fixed;" width="100%" class="infro_table">
											<thead>
												<tr>
													<th class="apps_firstth1 apps_firstth2 textL" colspan="4">
														申请人信息
													</th>
												</tr>
											</thead>
											<tbody>
												<tr>
													<td class="apps_firstth1 textR">
														申请人
													</td>
													<td><%=row.get("applicantName")%></td>
													<td class="textR">
														证件号
													</td>
													<td class="apps_firstth2"><%=row.get("idNo")%></td>
												</tr>
												<tr>
													<td class="apps_firstth1 textR">
														性别
													</td>
													<td>
														<%
														    if ("m".equals(row.get("gender").toString())) {
														%>男<%
														    } else {
														%>女
														<%
														    }
														%>
													</td>
													<td class="textR">
														出生年月
													</td>
													<td class="apps_firstth2"><%=row.get("birthDate")%></td>
												</tr>
												<tr>
													<td class="apps_firstth1 textR">
														手机号
													</td>
													<td><%=row.get("mobileNo")%></td>
													<td></td>
													<td></td>
												</tr>
											</tbody>
										</table>
										<%if(!"1".equals(row.get("payStatus").toString())) { %>
										<table border="0" cellspacing="0" cellpadding="0"
											style="table-layout: fixed;" width="100%" class="infro_table">
											<thead>
												<tr>
													<th class="apps_firstth1 apps_firstth2 textL" colspan="4">
														付款信息
													</th>
												</tr>
											</thead>
											<tbody>
												<tr>
												    <td class="apps_firstth2">
														支付方向
													</td>
													<td class="apps_firstth2">
														金额
													</td>
													<td class="apps_firstth2">
														支付类型
													</td>
													<td class="apps_firstth2">
														付款时间
													</td>
												</tr>
												<tr>
												    <td class="apps_firstth2">
												       <% if("pay".equals(orderBillInfo.get("direction"))) {%>
												      		 支付
												       <%} else if("refund".equals(orderBillInfo.get("direction"))) {%>
												           	退款
												       <%} %>
												    </td>
													<td class="apps_firstth2"><%=orderBillInfo.get("amount")%></td>
													<td class="apps_firstth2">
														<%
														if (null != orderBillInfo.get("payType") && !"".equals(orderBillInfo.get("payType"))) {
														    if ("1".equals(orderBillInfo.get("payType").toString())) {
														%>
														手机支付
														<%
														    } else if ("2".equals(orderBillInfo.get("payType").toString())) {
														%>
														现场支付
														<%
														    } else {
														%>
														网银
														<%
														    }
														}
														%>
													</td>
													<td class="apps_firstth2">
													  <%if(null != orderBillInfo.get("mpayTime") && !"".equals(orderBillInfo.get("mpayTime"))) { %>
													     <%=orderBillInfo.get("mpayTime")%>
													  <%} %>
													</td>
												</tr>
											</tbody>
										</table>
										<%} %>
										
										<div class="btn_div">
											<%if("1".equals(row.get("payStatus").toString()) && "1".equals(row.get("reserveStatus").toString())) { %>
											    <!-- 未付款，并且预约保留未过期，是”取消订单“ -->
											    <a class="btn_blue" href="<%=contextPathHead%>/web2/reserve.do?method=repay&orderId=<%=row.get("orderId")%>" >继续支付</a>
											    &nbsp;&nbsp;
											    <a href="#" class="btn_blue" onclick="cancelOrder(<%=row.get("orderId")%>)">取消订单</a>
											<%} else if ("2".equals(row.get("payStatus").toString()) && "4".equals(row.get("reserveStatus").toString())){ %>
											  
											   <a class="btn_blue" href="<%=contextPathHead%>/web2/reserveManageAction.do?method=reserverOrderList&flag=
											    <%=null != request.getAttribute("flag") && !"".equals(request.getAttribute("flag"))? request.getAttribute("flag"):"2" %>&browseFalg=web">返回</a>&nbsp;&nbsp;
											   <!-- 已经付款的，并且预约未过期的，才出现“退号" -->
											   <a href="#" class="btn_blue" onclick="refundOrder(<%=row.get("orderId")%>);">退号</a>
											<%} %>   
										</div>
									</div>
									<div class="clear"></div>
								</div>
								<!--end bc-->
							</div>
							<!--end inbox-->
						</div>
						<!--end right_main_box_cont-->
						<div class="left_box_bottom mb8"></div>
					</div>
					<!--end main_box-->
				</div>
				<!--end main_right-->
			</div>
			<!--end main_left-->
		</div>
		<!--end main-->
		<div class="clear"></div>

		</div>
		<%=request.getSession().getAttribute("footerContentWeb")%>
	</body>
</html>